package io.bluerain.g4_tools.entities;

/**
 * Created by foredawn on 15-9-14.
 * 文件信息对象
 */
public class ResourceInfo {

    private String source;
    private String target;
    private int permissions;
    private boolean dir = false;
    private boolean recursive = true;
    private int subPermissions;
    private String fullPath;

    public ResourceInfo() {
    }

    public ResourceInfo(String source, String target, int permissions) {
        this.source = source;
        this.target = target;
        this.permissions = permissions;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    public int getPermissions() {
        return permissions;
    }

    public void setPermissions(int permissions) {
        this.permissions = permissions;
    }

    public boolean isDir() {
        return dir;
    }

    public void setDir(boolean dir) {
        this.dir = dir;
    }

    public boolean isRecursive() {
        return recursive;
    }

    public void setRecursive(boolean recursive) {
        this.recursive = recursive;
    }

    public int getSubPermissions() {
        return subPermissions;
    }

    public void setSubPermissions(int subPermissions) {
        this.subPermissions = subPermissions;
    }

    public String getFullPath() {
        String name = "";
        if (source.indexOf("/") == -1)
            name = source;
        else
            name = source.substring(source.indexOf("/") + 1, source.length());
        return getTarget() + name;
    }
}
